% Simulink.importExternalCTypes('../CustomCode/SysIdParamLoading.h')

clear
Simulink.data.dictionary.closeAll()
delete('../StepperMotorControl.sldd');
% Simulink.data.dictionary.create('../LADRC_CurrentLoop_DataType.sldd')

% ImportFileStr = {'../ControlTypeDefine.h'}
% IncludeDirsStr = {'../rtwtypes.h'}

ImportFileStr = {...
%                  '../../Source/StepperMotorController.h'...
%                  '../../Source/Application/Algorithm/Foc.h',...
                 '../../Source/Application/Algorithm/Pid.h',...
%                  '../../Source/Application/Controller/ThreeLoopPidFocV1_0.h',...
%                  '../../Source/Driver/DriverBoard/CloseLoopV1_2.h',...
%                  '../../Source/Driver/Encoder/Heidenhai_14bit.h',...
%                  '../../Source/Driver/Mcu/STC32G8K64.h',...
%                  '../../Source/Driver/Mcu/STC32G12K128.h',...
%                  '../../Source/Driver/StepperMotor/Corier_4020.h',...
%                  '../../Source/Driver/StepperMotor/Corier_6030.h',...
                 };

IncludeDirsStr = {'../../Source' ...
                   '../../Library' ...
                   '../../Source/Application' ...
                   '../../Source/Application/CommandInteractor' ...
                   '../../Source/Application/Controller' ...
                   '../../Source/Application/Logger' ...
                   '../../Source/Application/ProtectiveSystem' ...
                   '../../Source/Application/TrajectoryGenerator' ...
                   '../../Source/Application/Algorithm' ...
                   '../../Source/Driver' ...
                   '../../Source/Driver/DriverBoard' ...
                   '../../Source/Driver/Encoder' ...
                   '../../Source/Driver/Mcu' ...
                   '../../Source/Driver/StepperMotor' ...
                   '../../Source/ConfigOption' ...
                   '../../Source/ConfigOption/Application' ...
                   '../../Source/ConfigOption/Driver' ...
                   '../../Source/Common' ...
                   };

Simulink.importExternalCTypes(ImportFileStr,...
    'IncludeDirs',IncludeDirsStr,...
    'Defines','HARDWARE_DISABLE',...
    'DataDictionary','StepperMotorControl.sldd',...
    'OutputDir','../');
% Simulink.importExternalCTypes('../../Source/Application/Algorithm/Pid.h',...
%     'IncludeDirs',IncludeDirsStr,...
%     'DataDictionary','StepperMotorControl.sldd',...
%     'OutputDir','../');